﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "diameterpiechart.h"
#include "tabledata.h"
#include "QScrollArea"
#include "csv.h"


namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    Csv csv;
    explicit MainWindow(QWidget *parent = 0);
    void RefreshDiv();
    void UpdateUI(std::string str);
    int FindWhichClass(double Value);
    static void UpdateUI_Ex(std::string str);
    static unsigned int PLCMessage(void* pVoid);
    void OnInit();
//    void OnTimer();
    void UpdateData();
    void RefreshTableData(std::vector<std::pair<std::string, int>> &Items, int Index = 0);
    TableData *pTableData = nullptr;
    QScrollArea *pSCrollArea = nullptr;
    ~MainWindow();
    std::vector<std::pair<std::string, int>> ValueOfDi;
    std::vector<QLineEdit*> LineEdit;
    std::vector<QLabel*> Labels;
private slots:
    void on_pushButton_Quit_clicked();

    void on_pushButton_Clear_clicked();

    void on_pushButton_OpenFile_clicked();

    void on_pushButton_MinWindow_clicked();

    void on_pushButton_StartSerials_clicked();

 //   void on_pushButton_Divides_clicked();

private:
    Ui::MainWindow *ui;
    DiameterPieChart *DiaPie = nullptr;
};

#endif // MAINWINDOW_H
